$(document).ready(function(){
	
	$(window).keydown(function(event){
		switch(event.keyCode) {
			case 13:login();
			break;
		}
	});
	
	$(document).on("click",".a_log_but div",function(){
		login();
	});
	
	$(".log_logo").animate({
		width: "740px",
		height: "500px",
		paddingTop: "300px",
		paddingLeft: "60px",
		left: "-30px",
		top: "-100px",
		opacity: "1"
	},2000);
	$(".log_inpu").animate({
		width: "420px",
		height: "340px",
		paddingTop: "80px",
		left: "820px",
		top: "30px",
		opacity: "1"
	},2000);
	$(".log_jrwm").animate({
		width: "120px",
		height: "70px",
		paddingTop: "50px",
		left: "1100px",
		top: "400px",
		opacity: "1"
	},2000);
});

function login() {
	var acc = $("#acc").val();
	var pwd = $("#pwd").val();
	var c = true;
	if(pwd==null||pwd==""){
		c = confirm("你没有填写密码！请确认你是不是考试人员！");
	}
	if(c){
		$.ajax({
			url: "login_dl",
			data:{
				acc:acc,
				pwd:pwd
			},
			async: false,
			traditional: true,
			success: function(data){
				if(data==-1){
					alert("登录失败！");
				}else if(data==-3){
					alert("你已经不是该公司员工了，没有权限访问该公司。");
				}
				if(data>0||data==-2){
					window.location.reload();
				}
			}
		});
	}
}
